//import static netscape.security.Privilege.add;

public class Example30 {
    public static void main(String[] args) {
        int[] arr = {6,8,9,5,2,15,23,12,55,24};
        for (int j = 0; j < arr.length; j++) {
            for (int i = arr.length-1; i >0 ; i--) {
                if (arr[i] > arr[i-1]){
                    int temp = arr[i];
                    arr[i] = arr[i-1];
                    arr[i-1] = temp;
                }
            }
            System.out.print("第" + (j+1) + "轮排序后：");
            printArray(arr);
        }
}

    public static void printArray(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
        System.out.print("\r\n");
    }
}
